import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { resolve } from 'path'
import WindiCSS from 'vite-plugin-windicss'

// 路径查找
const pathResolve = (dir) => {
  return resolve(__dirname, dir)
}

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), WindiCSS()],
  resolve: {
    alias: {
      '@': pathResolve('src'),
      components: pathResolve('./src/components'),
      hooks: pathResolve('./src/hooks'),
      views: pathResolve('./src/views')
    }
  }
})
